package com.acme;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;


public class AwardLevels extends ListActivity {

	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.text_list);  
        
        String[] levels = getResources().getStringArray(R.array.levels_array);
        setListAdapter(new ArrayAdapter<String>(this, R.layout.text_list_item, levels));
    }
		
	public void onListItemClick(ListView parent, View view, int position, long id) {
		CharSequence value = ((TextView) view).getText();
		Toast.makeText(getApplicationContext(), ((TextView) view).getText(),
     	          Toast.LENGTH_SHORT).show();
		
		if(value.equals( getResources().getString(R.string.COLLEGE)) ){
			Intent newIntent = new Intent(AwardLevels.this, CollegeAwards.class);
			AwardLevels.this.startActivity(newIntent);
		}
		else if(value.equals( getResources().getString(R.string.NFL)) ){
			Intent newIntent = new Intent(AwardLevels.this, NFLAwards.class);
			AwardLevels.this.startActivity(newIntent);
		}
	}

}
